package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IPropertyConfigDao;
import com.guoxue.domain.PropertyConfigVo;

@Repository
public class PropertyConfigDaoImpl extends BaseDaoImpl<PropertyConfigVo> implements IPropertyConfigDao {

	@Override
	public void savePropertyConfig(PropertyConfigVo pc) {
		saveOrUpdate(pc);
	}

	@Override
	public List<PropertyConfigVo> getPropertyConfigList() {
		return find("From PropertyConfigVo");
	}

	@Override
	public void deleteProperty(int id) {
		executeHql("DELETE FROM PropertyConfigVo p WHERE p.propId=?", new Object[] {id});
	}

	@Override
	public PropertyConfigVo getPropertyConfigById(int propertyConfigId) {
		return get("From PropertyConfigVo p WHERE p.propId = ? ", new Object[] {propertyConfigId});
	}

}
